***************************************
*          @@  FLEX 3 @@              *                  
*                                     *
*   ------ >> Chapitre 3 << ------    *
*                                     *
***************************************




java version

mxmlc options fichier

compc -o composant.swc 

-root fichierMXML.mxml


<?xml version="1.0" encoding="utf-8"?>

<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">

<!-- Ajout du panneau !-->
<mx:Panel x="10" y="10" width="270" height="150" layout="absolute" title="Hello World !!">
<!-- Ajout du bouton !-->
	<mx:Button label="Hello !!" width="120" horizontalCenter="0" verticalCenter="0"/>
</mx:Panel>
	
</mx:Application>



import mx.controls.Alert;

public function afficherMessage():void
{
Alert.show("Hello World !!");
	}




<mx:Script source="HelloActionScript.as"></mx:Script>

<mx:Button label="Hello !!" width="120" horizontalCenter="0" verticalCenter="0" click="afficherMessage()"/>



<?xml version="1.0" encoding="utf-8"?>

<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">

<mx:Script source="HelloActionScript.as"></mx:Script>

<mx:Panel x="10" y="10" width="270" height="150" layout="absolute" title="Hello World !!">
	<mx:Button label="Hello !!" width="120" horizontalCenter="0" verticalCenter="0" click="afficherMessage()"/>
</mx:Panel>
	
</mx:Application>




mxmlc ../samples/HelloWorld/src/Helloworld.mxml



<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/1998/REC-html40-19980424/strict.dtd">

<html>
	<head>
	    <title>Hello World !</title>
	    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	</head>

	<body>
	    <p>
	        <object type="application/x-shockwave-flash" data="HelloWorld.swf" width="100%" height="100%">
	        <param name="movie" value="HelloWorld.swf">
	        </object>
	    </p>
	</body>

</html>





<?xml version="1.0" encoding="utf-8"?>

<project name="Compilateur HelloWorld">

</project>
<taskdef resource="flexTasks.tasks" classpath="c:/root_flexsdk/ant/lib/flexTasks.jar" />
<property name="FLEX_HOME" value="c:/root_flexsdk"/>
<property name="APPLICATION_HOME" value="c:/root_flexsdk/samples/HelloWorld/src"/>
<target name="compilation">

</target>
<echo message=">> Gnration du fichier SWF" />

<mxmlc file="${APPLICATION_HOME}/HelloWorld.mxml"></mxmlc>




<?xml version="1.0" encoding="utf-8"?>

<project name="My App Builder">
<taskdef resource="flexTasks.tasks" classpath="c:/root_flexsdk/ant/lib/flexTasks.jar" />
    <property name="FLEX_HOME" value="c:/root_flexsdk"/>
    <property name="APPLICATION_HOME" value="c:/root_flexsdk/samples/HelloWorld/src"/>

    <target name="compilation">
        <echo message=">> Gnration du fichier SWF" />

<mxmlc file="${APPLICATION_HOME}/HelloWorld.mxml"></mxmlc>
    </target>

</project>



cd c:\root_flexsdk\ant
ant -buildfile HelloWorld.xml compilation



<target name="generationHTML" depends="compilation">
	
	<echo message=">> Gnration du fichier HTML" />

	<html-wrapper
	    swf = "HelloWorld"
	    height = "100%"
	    width = "100%"
	    application = "HelloWorld"
	    template = "express-installation"
	    version-major = "9"
	    version-minor = "0"
	    version-revision = "0"
	    output="${APPLICATION_HOME}"
	    title = "Hello World !!"/>

	</target>




<project name="My App Builder" default="generationHTML">
ant -buildfile HelloWorld.xml



<?xml version="1.0" encoding="utf-8"?>

<project name="My App Builder" default="generationHTML">
	<taskdef resource="flexTasks.tasks" classpath="c:/root_flexsdk/ant/lib/flexTasks.jar" /> 

	<property name="APPLICATION_HOME" value="c:/root_flexsdk/samples/HelloWorld/src"/>

    <target name="compilation">
        <echo message=">> Gnration du fichier SWF" />
        <mxmlc file="${APPLICATION_HOME}/HelloWorld.mxml"></mxmlc>
	    </target>

	    <target name="generationHTML" depends="compilation">
	        <echo message=">> Gnration du fichier HTML" />
        <html-wrapper
	            swf = "HelloWorld"
	            height = "100%"
	            width = "100%"
	            application = "HelloWorld"
	            template = "express-installation"
	            version-major = "9"
	            version-minor = "0"
	            version-revision = "0"
	            output="${APPLICATION_HOME}"
	            title = "Hello World !!"/>
    </target>

</project>




@ECHO OFF
cls 

echo ***************************************
echo .:::::      COMPILATION ANT      :::::.
echo ***************************************

ant -buildfile c:\root_flexsdk\ant\HelloWorld.xml
